//------------------------------------------------------------------------------
//	file dd.h
//
//	brief
//		data-display / data-dump (header file)
//
//	Description
//
//	$Id: dd.h 363 2015-03-06 19:10:49Z ac.verbeck@gmail.com $
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//	The MIT License (MIT)
//
//	Copyright (c) 2014 A.C. Verbeck
//
//	Permission is hereby granted, free of charge, to any person obtaining a copy
//	of this software and associated documentation files (the "Software"), to deal
//	in the Software without restriction, including without limitation the rights
//	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//	copies of the Software, and to permit persons to whom the Software is
//	furnished to do so, subject to the following conditions:
//
//	The above copyright notice and this permission notice shall be included in
//	all copies or substantial portions of the Software.

//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//	THE SOFTWARE.
//------------------------------------------------------------------------------

typedef enum { I2C_READ, I2C_WRITE, I2C_READ_ONLY	} I2C_XFER_E;				//	I2C transfer type
typedef enum { DD_ALL, DD_NONE, DD_ADDRESS			} XFER_ADDR_E;				//	Address filter types

typedef struct {
	uint32_t		addr;														//	I2C address
	uint32_t		stat;														//	I2C transfer status
	uint32_t		txCt;														//	transmit count
	uint32_t		rxCt;														//	receive count
	const uint8_t*	pTx;														//	pointer to the transmit buffer
	const uint8_t*	pRx;														//	pointer to the receive buffer
} I2C_INFO_BLK_T;																//	new type: I2C info block

void dd_init(void);																//	generic init for the dd system

void dd_full(const uint8_t* p, uint32_t sz);									//	full print (headers, address tags, etc.)
void dd_mini(const uint8_t* p, uint32_t sz);									//	mini print (just the data)

I2C_INFO_BLK_T*	dd_i2c_get_block(void);											//	get the I2C information block
void			dd_i2c_set_filter(XFER_ADDR_E t, uint32_t a);					//	set a filter for dd_i2c_xfer_info()
void			dd_i2c_print(I2C_XFER_E t, I2C_INFO_BLK_T* ib);					//	print the information block

//
//	End: dd.h
//
